<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .warp {
            display: flex;
            width: 600px;
            height: 600px;
            background-color: green;
            align-items: center;
            justify-content: center;
        }
        .planet {
            width: 200px;
            height: 200px;
            border: 2px solid #fff;
            /* margin: 0 auto; */
            transform-style: preserve-3d;
            position: absolute;
            border-radius: 50%;
            /* transform: scaleY(0.5) rotateZ(45deg); */
            /* 找到离他最近的position属性不为static元素定位 */
            animation: planet-rotate 20s linear infinite;
        }
        @keyframes planet-rotate {
            0% {
                transform: rotate(45deg) scaleY(0.5) rotate(0);
            }
            100% {
                transform: rotate(45deg) scaleY(0.5) rotate(360deg) ;
            }
        }
        @keyframes self-rotate {
            0% {
                transform: scaleY(2) rotate(0);
            }
            100% {
                transform: scaleY(2) rotate(-360deg) ;
            }
        }
        .ball {
            width: 50px;
            height: 50px;
            position: absolute;
            background-color: yellowgreen;
            border-radius: 50%;
            top: -25px;
            left: calc(50% - 25px);
            /* transform: rotateZ(-45deg) scaleY(2); */
            /* 所在planet盒子顺时针转了45度，自身要逆时针转45度，回到初始起点 */
            animation: self-retate 20s linear infinite;
        }
        
    </style>
</head>
<body>
    <div class="warp">
        <!-- 星球 -->
        <div class="planet">
            <div class="ball"></div>
        </div>
    </div>
</body>
</html>